﻿using System;
using System.ComponentModel.DataAnnotations;
using ServiceStack.DataAnnotations;

namespace NetSurveillance.WebApp.DataServices.Models
{
    [Alias("DataRecords")]
    public class DataRecord : BaseModel
    {
        [AutoIncrement]
        public long Id { get; set; }

        [References(typeof(Host))]
        public long HostId { get; set; }

        [References(typeof(Task))]
        public long TaskId { get; set; }

        [References(typeof(SensitiveAccount))]
        public long? SensitiveAccountId { get; set; }

        [References(typeof(DataIMRecord))]
        public long? DataIMRecordId { get; set; }

        /// <summary>
        /// 上行、下行数据
        /// </summary>
        [StringLength(10)]
        public string DataRecordType { get; set; }

        [StringLength(10)]
        public string Protocol { get; set; }

        [StringLength(20)]
        public string ActionCode { get; set; }

        [StringLength(300)]
        public string Title { get; set; }

        public string Content { get; set; }

        /// <summary>
        /// 文件解码状态
        /// 0 默认值，无解码；1 解码完成；2 解码失败 
        /// </summary>
        [Default(typeof(int), "0")]
        public int AnalyzeStatus { get; set; }

        [StringLength(500)]
        public string FilePath { get; set; }

        [StringLength(32)]
        public string FileType { get; set; }

        [StringLength(1000)]
        public string Url { get; set; }

        [StringLength(1000)]
        public string MailCC { get; set; }

        [StringLength(500)]
        public string MailFrom { get; set; }

        [StringLength(1000)]
        public string MailTo { get; set; }

        public DateTime? MailDate { get; set; }

        [StringLength(32)]
        public string RemoteIP { get; set; }

        [StringLength(32)]
        public string RemoteMac { get; set; }

        [StringLength(64)]
        public string SoftvareVer { get; set; }

        [StringLength(64)]
        public string SystemInfo { get; set; }
    }
}